package bishi.day28_5_26;
import java.util.*;
/**
 * 猴子分桃
 * @author 是阿秋啊
 * @date 2022/05/26 14:48
 **/
public class houzi_fentao {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            int n = sc.nextInt();
            if(n == 0) {
                break;
            }
            if(n == 1) {
                System.out.println(1 + " " + 1);
                continue;
            }
            long a = (long)Math.pow(5,n) - 4;
            long b = (long)Math.pow(4,n) + n - 4;
            System.out.println(a + " " + b);
        }
    }
}